<div class="layuimini-main">

    <div lay-filter="userForm" class="layui-form layuimini-form">
		<input id="pageParam" style="display: none" />
		<div class="layui-form-item hide">
            <label class="layui-form-label required"></label>
            <div class="layui-input-block">
                <input type="text" name="id" value="" class="layui-input">
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label required">id</label>
            <div class="layui-input-block">
                <input type="text" disabled name="id" required lay-verify="required" lay-reqtext="id不能为空" placeholder="请输入id" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label required">用户名</label>
            <div class="layui-input-block">
                <input type="text" disabled name="userName" required lay-verify="required" lay-reqtext="用户名不能为空" placeholder="请输入用户名" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label required">密码</label>
            <div class="layui-input-block">
                <input type="text" disabled name="password" required lay-verify="required" lay-reqtext="密码不能为空" placeholder="请输入密码" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">权限</label>
            <div class="layui-input-block">
                <input type="text" disabled name="role" placeholder="请输入权限" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">身高</label>
            <div class="layui-input-block">
                <input type="text" disabled name="height" placeholder="请输入身高" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">体重</label>
            <div class="layui-input-block">
                <input type="text" disabled name="weight" placeholder="请输入体重" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">低血压值</label>
            <div class="layui-input-block">
                <input type="text" disabled name="hypotensiveValue" placeholder="请输入低血压值" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">高血压值</label>
            <div class="layui-input-block">
                <input type="text" disabled name="hypertensiveValue" placeholder="请输入高血压值" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">血糖值</label>
            <div class="layui-input-block">
                <input type="text" disabled name="bloodGlucoseValue" placeholder="请输入血糖值" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">血脂值</label>
            <div class="layui-input-block">
                <input type="text" disabled name="bloodLipidValue" placeholder="请输入血脂值" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">50米短跑完成秒数</label>
            <div class="layui-input-block">
                <input type="text" disabled name="50MeterDashTime" placeholder="请输入50米短跑完成秒数" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">引体向上次数</label>
            <div class="layui-input-block">
                <input type="text" disabled name="pullUpTimes" placeholder="请输入引体向上次数" value="" class="layui-input">
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label ">俯卧撑次数</label>
            <div class="layui-input-block">
                <input type="text" disabled name="pushUpTimes" placeholder="请输入俯卧撑次数" value="" class="layui-input">
            </div>
        </div> 

    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        // userId
        let userId = $('#pageParam').val()
        if(userId){
            $.ajax({
                url: '/api/getUserById',
                type: 'GET',
                data: {id: userId},
                success: function(response){
                    form.val('userForm', response.data);
                    form.render();
                }
            });
        }
    });
</script>